home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / ContentHandler.java < prev    next >
Text File  |  1998-09-22  |  2KB  |  59 lines

  1. /*
  2.  * @(#)ContentHandler.java    1.8 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.net;
  16.  
  17. import java.io.IOException;
  18.  
  19. /**
  20.  * The abstract class <code>ContentHandler</code> is the superclass 
  21.  * of all classes that read an <code>Object</code> from a 
  22.  * <code>URLConnection</code>. 
  23.  * <p>
  24.  * An application does not generally call the 
  25.  * <code>getContent</code> method in this class directly. Instead, an 
  26.  * application calls the <code>getContent</code> method in class 
  27.  * <code>URL</code> or in <code>URLConnection</code>.
  28.  * The application's content handler factory (an instance of a class that 
  29.  * implements the interface <code>ContentHandlerFactory</code> set 
  30.  * up by a call to <code>setContentHandler</code>) is 
  31.  * called with a <code>String</code> giving the MIME type of the 
  32.  * object being received on the socket. The factory returns an 
  33.  * instance of a subclass of <code>ContentHandler</code>, and its 
  34.  * <code>getContent</code> method is called to create the object. 
  35.  *
  36.  * @author  James Gosling
  37.  * @version 1.8, 07/01/98
  38.  * @see     java.net.ContentHandler#getContent(java.net.URLConnection)
  39.  * @see     java.net.ContentHandlerFactory
  40.  * @see     java.net.URL#getContent()
  41.  * @see     java.net.URLConnection
  42.  * @see     java.net.URLConnection#getContent()
  43.  * @see     java.net.URLConnection#setContentHandlerFactory(java.net.ContentHandlerFactory)
  44.  * @since   JDK1.0
  45.  */
  46. abstract public class ContentHandler {
  47.     /** 
  48.      * Given a URL connect stream positioned at the beginning of the 
  49.      * representation of an object, this method reads that stream and 
  50.      * creates an object from it. 
  51.      *
  52.      * @param      urlc   a URL connection.
  53.      * @return     the object read by the <code>ContentHandler</code>.
  54.      * @exception  IOException  if an I/O error occurs while reading the object.
  55.      * @since      JDK1.0
  56.      */
  57.     abstract public Object getContent(URLConnection urlc) throws IOException;
  58. }
  59.